CMAKE_MINIMUM_REQUIRED(VERSION 3.9.6)

PROJECT(FastWindingNumber)
SET(CMAKE_CXX_STANDARD 11)

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

IF (NOT TBB_FOUND)
    FIND_PACKAGE(TBB REQUIRED)

    ADD_LIBRARY(TBB::tbb INTERFACE IMPORTED)
    TARGET_INCLUDE_DIRECTORIES(TBB::tbb SYSTEM INTERFACE ${TBB_INCLUDE_DIRS})
    TARGET_LINK_LIBRARIES(TBB::tbb INTERFACE
        ${TBB_LIBRARIES})

    ADD_LIBRARY(TBB::tbbmalloc INTERFACE IMPORTED)
    TARGET_INCLUDE_DIRECTORIES(TBB::tbbmalloc SYSTEM INTERFACE
        ${TBB_MALLOC_INCLUDE_DIRS})
    TARGET_LINK_LIBRARIES(TBB::tbbmalloc INTERFACE
        ${TBB_MALLOC_LIBRARIES})

    ADD_LIBRARY(TBB::tbbmalloc_proxy INTERFACE IMPORTED)
    TARGET_INCLUDE_DIRECTORIES(TBB::tbbmalloc_proxy SYSTEM INTERFACE
        ${TBB_MALLOC_PROXY_INCLUDE_DIRS})
    TARGET_LINK_LIBRARIES(TBB::tbbmalloc_proxy INTERFACE
        ${TBB_MALLOC_PROXY_LIBRARIES})
ENDIF (NOT TBB_FOUND)
add_subdirectory(./src)